package com.mindskip.xzs.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import java.io.Serializable;

/**
 * @author artka
 * @description:
 * @date 2022/9/14 12:11 AM
 */
@Data
@Accessors(chain = true)
@TableName(value = "department_user")
public class DepartmentUser extends Model<DepartmentUser> implements Serializable {

    private static final long serialVersionUID = -4664395799538068273L;

    private Integer id;

    @TableField(value = "dept_id")
    private Long deptId;

    @TableField(value = "user_qywx_id")
    private String userQywxId;

    /**
     * 是否兼职
     */
    private Boolean sideline;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        DepartmentUser that = (DepartmentUser) o;

        return new EqualsBuilder().append(id, that.id).append(deptId, that.deptId).append(userQywxId, that.userQywxId).isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37).append(id).append(deptId).append(userQywxId).toHashCode();
    }
}
